/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package Commons.Replicazione;

import Commons.Logging.Logger;
import Manager.Manager;
import javax.xml.stream.XMLStreamException;

/**
 *
 * @author Team5
 */
public class RMManager {

    private StatoManager stato;
    private WSClientRMManager ws;
   
    
       

    public RMManager() {
        stato=new StatoManager();
        ws=new WSClientRMManager();
        System.out.println("RMManager()");
}

    public void aggiornaStato(Manager m) throws XMLStreamException{
        System.out.println("RMManager() aggiornastato()");
        stato.aggiornaStato(m);
        ws.inviaStato(stato);

    }

    
    public StatoManager recuperaStato(){
        System.out.println("bootstrap");
        stato= ws.bootstrap(stato.getIdManager());
        return stato;
    }

}
